package com.itheima.课件.charstream.mycharstream;

import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;

public class Test {
    public static void main(String[] args) throws IOException {
        //1. 创建输入输出流对象
        FileReader fr = new FileReader("day13_字符流&properties\\b.txt");
        FileWriter fw = new FileWriter("day13_字符流&properties\\a.txt");

        //2. 定义一个传输数据的容器
        char[] chs = new char[1024];
        int len;

        //3. 循环读写
        while ((len = fr.read(chs)) != -1){
            fw.write(chs,0,len);
        }

        //4. 关流,释放资源
        fw.close();
        fr.close();
    }
}
